package com.zhiyou.controller;

import com.zhiyou.bean.Type;
import com.zhiyou.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/type")
public class TypeController {

    @Autowired
    TypeService typeService;

    @RequestMapping("/getAll")
    @ResponseBody
    public List<Type> getAllTypes(){
        return typeService.getAllTypes();
    }

}
